<!DOCTYPE html>
<html>
<head>
    <title>设备备件关联</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.devName" @on-enter="query" placeholder="设备名称"></i-input>
                </i-col>
                <i-col span="4">
                    <i-input v-model="q.devProductName" @on-enter="query" placeholder="生产线名称/生产线代码"></i-input>
                </i-col>
                <i-col span="4">
                    <i-input v-model="q.devProceName" @on-enter="query" placeholder="工序名称/工序号"></i-input>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                #if($shiro.hasPermission("sparepartdev:review"))
                <i-button type="primary" @click="review"><i class="fa fa-gavel"></i>&nbsp;审核</i-button>
                #end
                #if($shiro.hasPermission("sparepartdev:save"))
                <i-button type="info" @click="getDeviceInfo"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                <!--#if($shiro.hasPermission("sparepartdev:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end-->
                #if($shiro.hasPermission("sparepartdev:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
	    <table id="jqGrid"></table>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
		<i-form ref="formValidate" :model="sparePartDev" :rules="ruleValidate" :label-width="80">
            <Row>
                <i-col span="11">
                    <Form-item label="选择设备" prop="deviceInfo">
                        <i-select v-model="deviceInfo" @on-change="getByDeviceId" placeholder="请选择">
                            <i-option v-for="device in deviceList" :value="device" :key="device">{{device.devCode}} {{device.devName}}
                            </i-option>
                        </i-select>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="设备编码" prop="devCode">
                        <i-input v-model="deviceInfo.devCode" placeholder="设备编码" disabled></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="设备名称" prop="devName">
                        <i-input v-model="deviceInfo.devName" placeholder="设备名称" disabled></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="大类" prop="devTypeB">
                        <i-input v-model="deviceInfo.devTypeBName" placeholder="大类" disabled></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="中类" prop="devTypeM">
                        <i-input v-model="deviceInfo.devTypeMName" placeholder="中类" disabled></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="小类" prop="devTypeS">
                        <i-input v-model="deviceInfo.devTypeSName" placeholder="小类" disabled></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="所属车间" prop="devFarm">
                        <i-input v-model="deviceInfo.devFarm" placeholder="所属车间" disabled></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="生产线代码" prop="devProductCode">
                        <i-input v-model="deviceInfo.devProductCode" placeholder="生产线代码" disabled></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="生产线名称" prop="devProductName">
                        <i-input v-model="deviceInfo.devProductName" placeholder="生产线名称" disabled></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="工序号" prop="devProceNo">
                        <i-input v-model="deviceInfo.devProceNo" placeholder="工序号" disabled></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="工序名称" prop="devProceName">
                        <i-input v-model="deviceInfo.devProceName" placeholder="工序名称" disabled></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="品牌" prop="devBrand">
                        <i-input v-model="deviceInfo.devBrand" placeholder="品牌" disabled></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="供应厂家" prop="devSupply">
                        <i-input v-model="deviceInfo.devSupply" placeholder="供应厂家" disabled></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="所属项目" prop="devProject">
                        <i-input v-model="deviceInfo.devProject" placeholder="所属项目" disabled></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="设备类型" prop="devKind">
                        <i-select v-model="deviceInfo.devKind" disabled>
                            <i-option value="1">普通设备</i-option>
                            <i-option value="2">特种设备</i-option>
                        </i-select>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="24">
                    <Form-item label="设备描述" prop="devDescr">
                        <i-input type="textarea" v-model="deviceInfo.devDescr" placeholder="设备描述" disabled></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px">返回</i-button>
                <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
	</Card>
</div>

<script src="${rc.contextPath}/js/spare/sparepartdev.js?_${date.systemTime}"></script>
</body>
</html>
